﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.Web.Routing;

namespace SimpComm
{
    static public partial class ElementExtensions
    {
        public static MvcHtmlString Niko_Rate<TModel>(this HtmlHelper<TModel> htmlHelper, string InputID, object value, string transfun = "rate_tran1", bool isonlyread = false)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(" <div class=\"niko_rate\">");
            sb.Append(" <input type=\"hidden\" id=\"" + InputID + "\" value=\"" + value + "\" default_value=\"" + value + "\">");
            sb.Append(" <div class=\"rateit antenna2\" data-rateit-backingfld=\"#" + InputID + "\"");
            sb.Append(" data-rateit-resetable=\"false\" data-rateit-ispreset=\"true\" data-rateit-step=\"1\"");
            sb.Append("  data-rateit-min=\"0\" data-rateit-max=\"5\" data-rateit-starwidth=\"26\" data-rateit-starheight=\"25\">");
            sb.Append("  </div>");
            sb.Append("  <span class=\"operate_value\" transfun=\""+transfun+"\" style=\"\"></span>");
            sb.Append("  </div>");

            return new MvcHtmlString(sb.ToString());
        }
    }
}
